package com.dk.service.impl;

import com.alibaba.druid.util.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.dk.mapper.YearsMapper;
import com.dk.pojo.Tbseries;
import com.dk.pojo.Tbyears;
import com.dk.service.YearsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.function.Predicate;

@Service
public class YearsServiceimpl implements YearsService {

    @Autowired
    private YearsMapper yearsMapper;
    @Override
    public List<Tbyears> getYears(String seriesId) {
        /*java8新特性 方法的引用*/
        LambdaQueryWrapper<Tbyears> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        LambdaQueryWrapper<Tbyears> eq = lambdaQueryWrapper.eq(!StringUtils.isEmpty(seriesId),Tbyears::getSeriesId, seriesId);
        List<Tbyears> tbyears = yearsMapper.selectList(eq);
        return tbyears;
    }
}
